﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace XQ.Net.Test.UI
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Thread thread = new Thread(log);
            thread.Start();
        }

        private void log()
        {
            while (true)
            {

            XQ.Net.SDK.XQAPI.OutPutLog("2s一次！");
                Thread.Sleep(2000);
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Task.Factory.StartNew(async () =>
            {
                XQ.Net.SDK.XQAPI.OutPutLog("2s一次！");
                await Task.Delay(2000);
            });
        }
    }
}
